x86/svm: Correct vm_event API for descriptor accesses
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 28 Nov 2019 11:28:51 +0000 (11:28 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 4 Dec 2019 19:05:00 +0000 (19:05 +0000)
commitad5c7c162519a3f96561ea4791da1319d9bfdfed
tree3aca749d0ea7857114ba378d145eaab5a6a8d72e
parent05de315b00bf2951617b8ef28811b1f1f2dd5742
x86/svm: Correct vm_event API for descriptor accesses

c/s d0a699a389f1 "x86/monitor: add support for descriptor access events"
introduced logic looking for what appeared to be exitinfo (not that this
exists in SVM - exitinfo1 or 2 do), but actually passed the exit IDT vectoring
information.  There is never any IDT vectoring involved in these intercepts so
the value passed is always zero.

In fact, SVM doesn't provide any information, even in exitinfo1 and 2.  Drop
the svm struct entirely, and bump the interface version.

In the SVM vmexit handler itself, optimise the switch statement by observing
that there is a linear transformation between the SVM exit_reason and
VM_EVENT_DESC_* values.  (Bloat-o-meter reports 6028 => 5877 for a saving of
151 bytes).

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Alexandru Isaila <aisaila@bitdefender.com>
Acked-by: Adrian Pop <apop@bitdefender.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/monitor.c
xen/arch/x86/hvm/svm/svm.c
xen/include/public/vm_event.h